package com.ruoyi.cderp.service.impl;

import java.util.List;

import com.ruoyi.cderp.domain.ProductCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cderp.mapper.CategoryPropertyMapper;
import com.ruoyi.cderp.domain.CategoryProperty;
import com.ruoyi.cderp.service.ICategoryPropertyService;

/**
 * 商品类目和商品属性关系Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-17
 */
@Service
public class CategoryPropertyServiceImpl implements ICategoryPropertyService
{
    @Autowired
    private CategoryPropertyMapper categoryPropertyMapper;


    @Override
    public CategoryProperty selectCategoryPropertyPId(String pid) {
        return categoryPropertyMapper.selectCategoryPropertyPId(pid);
    }

    @Override
    public List<ProductCategory> selectProductCategoryList() {
        return categoryPropertyMapper.selectProductCategoryList();
    }


    /**
     * 新增商品类目和商品属性关系
     *
     * @param categoryProperty 商品类目和商品属性关系
     * @return 结果
     */
    @Override
    public int insertCategoryProperty(CategoryProperty categoryProperty)
    {
        return categoryPropertyMapper.insertCategoryProperty(categoryProperty);
    }

    /**
     * 修改商品类目和商品属性关系
     *
     * @param categoryProperty 商品类目和商品属性关系
     * @return 结果
     */
    @Override
    public int updateCategoryProperty(CategoryProperty categoryProperty)
    {
        return categoryPropertyMapper.updateCategoryProperty(categoryProperty);
    }

    @Override
    public int deleteCategoryPropertyBypId(String pid) {
        return categoryPropertyMapper.deleteCategoryPropertyBypId(pid);
    }

}
